package org.example.design.memento.test1;

import java.util.ArrayList;
import java.util.List;

/**
 * @author huangshen
 * @version 0
 * @description 表示Gamer状态的类
 * @since 2022/2/11 15:15
 */
public class Memento {
    private int money;

    private ArrayList<String> fruits;

    public Memento(int money) {
        this.money = money;
        this.fruits = new ArrayList<>();
    }

    void addFruit(String fruit) {
        fruits.add(fruit);
    }

    public List<String> getFruits() {
        return (List<String>)fruits.clone();
    }

    public int getMoney() {
        return money;
    }
}
